package com.leo.learning;

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;

import android.net.Uri;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.MediaController;
import android.widget.SeekBar;
import android.widget.TextView;

import java.io.IOException;
import java.net.URI;

public class Async extends AsyncTask<Object, Void, Void> {

	@Override
	protected Void doInBackground(Object... params) {
		// TODO Auto-generated method stub
		while(isCancelled() != true){
			((SeekBar)params[1]).setMax( ((MediaPlayer)params[0]).getDuration()	 );
			try {
				Thread.sleep(1000);
				((SeekBar)params[1]).setProgress(((MediaPlayer)params[0]).getCurrentPosition());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return null;
	}
	

	
}
